#region Microsoft Public License
/*
 * (c) Copyright Chenjun Wu. http://utablesdk.codeplex.com
 * 
 * This source is subject to the Microsoft Public License (Ms-PL).
 * Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
 * All other rights reserved.
 */
#endregion

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UTable.Objects;

namespace UTable.Input.Keyboard
{
    public interface IKeyboard
    {
        //
        // Summary:
        //     Gets the set of System.Windows.Input.ModifierKeys which are currently pressed.
        //
        // Returns:
        //     The set of modifier keys.
        ModifierKeys Modifiers { get; }
        //
        // Summary:
        //     Gets the specified System.Windows.IInputElement that input from this device
        //     is sent to.
        //
        // Returns:
        //     The element that receives input.
        IInputNode Target { get; }

        //
        // Summary:
        //     Sets keyboard focus on the specified UTable.Objects.IInputNode.
        //
        // Parameters:
        //   element:
        //     The element to move focus to.
        //
        // Returns:
        //     The element that has keyboard focus.
        IInputNode Focus(IInputNode element);
        //
        // Summary:
        //     Gets the set of key states for the specified System.Windows.Input.Key.
        //
        // Parameters:
        //   key:
        //     The key to check.
        //
        // Returns:
        //     The set of key states for the specified key.
        //
        // Exceptions:
        //   System.ComponentModel.InvalidEnumArgumentException:
        //     key is not a valid key.
        KeyStates GetKeyStates(Key key);
        //
        // Summary:
        //     Determines whether the specified System.Windows.Input.Key is in the down
        //     state.
        //
        // Parameters:
        //   key:
        //     The key to check.
        //
        // Returns:
        //     true if key is in the down state; otherwise, false.
        //
        // Exceptions:
        //   System.ComponentModel.InvalidEnumArgumentException:
        //     key is not a valid key.
        bool IsKeyDown(Key key);
        //
        // Summary:
        //     Determines whether the specified System.Windows.Input.Key is in the toggled
        //     state.
        //
        // Parameters:
        //   key:
        //     The key to check.
        //
        // Returns:
        //     true if key is in the toggled state; otherwise, false.
        //
        // Exceptions:
        //   System.ComponentModel.InvalidEnumArgumentException:
        //     key is not a valid key.
        bool IsKeyToggled(Key key);
        //
        // Summary:
        //     Determines whether the specified System.Windows.Input.Key is in the up state.
        //
        // Parameters:
        //   key:
        //     The key to check.
        //
        // Returns:
        //     true if key is in the up state; otherwise, false.
        //
        // Exceptions:
        //   System.ComponentModel.InvalidEnumArgumentException:
        //     key is not a valid key.
        bool IsKeyUp(Key key);

        /// <summary>
        /// 
        /// </summary>
        event KeyInputEventHandler KeyDown;
        /// <summary>
        /// 
        /// </summary>
        event KeyInputEventHandler KeyUp;
        /// <summary>
        /// 
        /// </summary>
        event KeyInputEventHandler KeyPressed;
    }
}
